/** 
*@Project: UIBase
*@�ļ����: ExternActivity.java 
*@Author: linlin.zou
*@Date: 2014-12-3 
*@Copyright: 2014 www.boshtc.com Inc. All rights reserved.

*ע�⣺�����ݽ������Ϻ�Ѽ���������޹�˾�ڲ����ģ���ֹ��й�Լ������������ҵĿ�� 
*/ 
package com.alipear.uibase;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;


public class ExternActivity extends ExternBaseActivity {
    // protected User user;
    private ProgressDialog mProgressDialog = null;
    private int nPDRef = 0;

    public ExternActivity(Activity owner) {
        super(owner);
    }

    @Override
    public void showProgressDialog(String message) {
        nPDRef++;
        if (mProgressDialog != null && mProgressDialog.isShowing()) {
            return;
        }
        mProgressDialog = ProgressDialog.show(getCurActivity(), "",message, true,
                true);
        mProgressDialog.setCanceledOnTouchOutside(false);
    }

    @Override
    public void showProgressDialog() {
        showProgressDialog(getCurActivity().getString(R.string.please_waiting));
    }

    @Override
    public void closeProgressDailog() {
        if (nPDRef != 1) {
            nPDRef--;
            return;
        }
        if (mProgressDialog != null && mProgressDialog.isShowing()) {
            mProgressDialog.dismiss();
            nPDRef = 0;
        }
    }


}
